home *** CD-ROM | disk | FTP | other *** search
/ Star Trek Starfleet Academy Mini Omnipedia / MINI_OMNI.ISO / pc / omni_v2.dxr / 00392_Backing Up.ls < prev    next >
Encoding:
Text File  |  1996-04-15  |  5.7 KB  |  190 lines

  1. global gModeState, gGlobalStepCount, gLocalStepCount, gAlphaState, gDefaultSettings, oIndexScroller, oIndexMediator, gTrackingList, gTrackMe, gInputField, gFirstReplayF, gNopeSND, gTheFTword, gFTsearchscope, gModeList, gTrackMode, gTrackingModeslist, gPiconcastloc, gPiconGarage, gNumofpicons, oIndexSlider
  2.  
  3. on hInitTracker
  4.   set gTrackMe to 1
  5.   set gTrackMode to 1
  6.   set gDefaultSettings to [:]
  7.   addProp(gDefaultSettings, #ENCY, [#ENCY, 1, 1, "A", 1, mGetThisEntryName(oIndexMediator, #ENCY, 1, 1)])
  8.   set gTrackingList to []
  9.   set gTrackingModeslist to [0, 0, 0, 0, 0, 0, 0]
  10. end
  11.  
  12. on hCaptureThisMoment
  13.   set LtempPacket to []
  14.   addAt(LtempPacket, 1, gModeState)
  15.   addAt(LtempPacket, 2, gGlobalStepCount)
  16.   addAt(LtempPacket, 3, gLocalStepCount)
  17.   if gModeState <> #EPISSUB then
  18.     addAt(LtempPacket, 4, hFilterSearchChars(the text of field gInputField))
  19.   else
  20.     addAt(LtempPacket, 4, gAlphaState)
  21.   end if
  22.   addAt(LtempPacket, 5, 0)
  23.   addAt(LtempPacket, 6, the text of field gInputField)
  24.   addAt(LtempPacket, 7, mWhatFSlistType(oIndexScroller))
  25.   addAt(LtempPacket, 8, gTheFTword)
  26.   addAt(LtempPacket, 9, gFTsearchscope)
  27.   if gTrackMe then
  28.     if count(gTrackingList) > 25 then
  29.       deleteAt(gTrackingList, 1)
  30.     end if
  31.     append(gTrackingList, LtempPacket)
  32.     set gFirstReplayF to 1
  33.   else
  34.     set gTrackMe to 1
  35.   end if
  36.   if gTrackMode then
  37.     hCaptureThisMode(LtempPacket)
  38.   else
  39.     set gTrackMode to 1
  40.   end if
  41. end
  42.  
  43. on hCaptureThisMode pTempPacket
  44.   set vThisPosition to getPos(gModeList, gModeState)
  45.   setAt(gTrackingModeslist, vThisPosition, pTempPacket)
  46. end
  47.  
  48. on hBackTrack
  49.   global gYouClickedF, gModeState
  50.   if count(gTrackingList) < 1 then
  51.     hReportStatus("There are no more entries to display by backing up.")
  52.     hearit(gNopeSND)
  53.     return 
  54.   end if
  55.   if gModeState = #CHRO then
  56.     set gYouClickedF to 1
  57.   end if
  58.   set gTrackMe to 0
  59.   if gFirstReplayF then
  60.     deleteAt(gTrackingList, count(gTrackingList))
  61.     set gFirstReplayF to 0
  62.   end if
  63.   set Lpacket to getLast(gTrackingList)
  64.   if voidp(Lpacket) then
  65.     return 
  66.   end if
  67.   hSetMode(getAt(Lpacket, 1))
  68.   hGoBack(Lpacket)
  69.   deleteAt(gTrackingList, count(gTrackingList))
  70. end
  71.  
  72. on hGoBack pTheseSettings
  73.   if not objectp(pTheseSettings) then
  74.     abort()
  75.   end if
  76.   set Lthenewmode to getAt(pTheseSettings, 1)
  77.   if not ((Lthenewmode = #FoundSet) or (Lthenewmode = #EPISSUB)) then
  78.     put getAt(pTheseSettings, 6) into field gInputField
  79.     hilite char 999 of field gInputField
  80.     hGetNewAttrList(getAt(pTheseSettings, 4), 0)
  81.     hMiniFind()
  82.     if gModeState = #CHRO then
  83.       if gGlobalStepCount > 3 then
  84.         hHiliteItem(4)
  85.       else
  86.         hHiliteItem(gGlobalStepCount)
  87.       end if
  88.       if count(getLast(gPiconGarage)) > 0 then
  89.         set gPiconcastloc to getaProp(gPiconGarage, gGlobalStepCount)
  90.         set gNumofpicons to count(gPiconcastloc)
  91.         hDisplayPicons()
  92.       else
  93.         if getaProp(gPiconGarage, gGlobalStepCount) = 0 then
  94.           hPurgeMedia()
  95.         end if
  96.       end if
  97.     end if
  98.   else
  99.     if Lthenewmode = #EPISSUB then
  100.       put getAt(pTheseSettings, 6) into field gInputField
  101.       hilite char 999 of field gInputField
  102.       mSwitchtoEpisSubindex(oIndexScroller, getAt(pTheseSettings, 4))
  103.       hMiniFind()
  104.     else
  105.       set Lsize to count(mGetModesAttribGroup(oIndexMediator, #FoundSet, 1))
  106.       set Lpointer to getAt(pTheseSettings, 2)
  107.       if Lpointer > Lsize then
  108.         hearit(gNopeSND)
  109.         hReportStatus("Sorry, cannot access that index.")
  110.         return 
  111.       end if
  112.       hSetGlobalCounter(getAt(pTheseSettings, 2))
  113.       hSetAlphaState(getAt(pTheseSettings, 4))
  114.       hSwitchFTsearchscope(#ENCY)
  115.       hputmsg("HgoBack calling hsetmode")
  116.       hSetMode(#FoundSet)
  117.       set gTheFTword to getAt(pTheseSettings, 8)
  118.       set gFTsearchscope to getAt(pTheseSettings, 9)
  119.       hRevisitFoundSet(getAt(pTheseSettings, 7))
  120.       mReDefineSlider(oIndexSlider, 1, mGetModesMaxEntryNum(oIndexMediator) - 6, 0)
  121.       mSetSlider(oIndexSlider, gGlobalStepCount)
  122.       mHighlightMyScrollLine(oIndexScroller, gGlobalStepCount)
  123.     end if
  124.   end if
  125. end
  126.  
  127. on hRecall pWhatMode
  128.   if pWhatMode <> #EPISSUB then
  129.     set vThisPosition to getPos(gModeList, pWhatMode)
  130.     set LmyItem to getAt(gTrackingModeslist, vThisPosition)
  131.     if LmyItem = 0 then
  132.       if gModeState = #FoundSet then
  133.         hearit(gNopeSND)
  134.         hReportStatus("No search has been performed in this session as yet.")
  135.         return 
  136.       end if
  137.     end if
  138.     if string(LmyItem) contains string(pWhatMode) then
  139.       if pWhatMode = #TOPICS then
  140.         set vListlen to count(getAt(mGetEntireMode(oIndexMediator, #TOPICS), 1))
  141.         if getAt(LmyItem, 3) <= vListlen then
  142.           set Lfound to 1
  143.         else
  144.           set Lfound to 0
  145.         end if
  146.       else
  147.         set Lfound to 1
  148.       end if
  149.     else
  150.       set Lfound to 0
  151.     end if
  152.   else
  153.     set Lfound to 0
  154.   end if
  155.   if Lfound = 1 then
  156.     hGoBack(getAt(gTrackingModeslist, vThisPosition))
  157.     if pWhatMode = #FoundSet then
  158.       mReDefineSlider(oIndexSlider, 1, mGetModesMaxEntryNum(oIndexMediator) - 6, 0)
  159.       set vMax to the iSliderMax of oIndexSlider
  160.       if gGlobalStepCount > vMax then
  161.         set gGlobalStepCount to vMax
  162.       end if
  163.       mSetSlider(oIndexSlider, gGlobalStepCount)
  164.       mHighlightMyScrollLine(oIndexScroller, gGlobalStepCount)
  165.     end if
  166.   else
  167.     hGoBack(getaProp(gDefaultSettings, pWhatMode))
  168.   end if
  169. end
  170.  
  171. on hRevisitFoundSet pListtype
  172.   mSetFSlistType(oIndexScroller, pListtype)
  173.   if pListtype = 0 then
  174.     hShowTheFoundHits(gGlobalStepCount, pListtype)
  175.   else
  176.     if pListtype = 1 then
  177.       hShowTheFoundHits(gGlobalStepCount, pListtype)
  178.     else
  179.       if pListtype = 2 then
  180.         hShowTheUpdate(pListtype)
  181.       else
  182.         if pListtype = 3 then
  183.           hShowTheUpdate(pListtype)
  184.         else
  185.         end if
  186.       end if
  187.     end if
  188.   end if
  189. end
  190.